package file;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;

public class ListFilesDemo3 {
    public static void main(String[] args) throws IOException {
        File dir = new File(".");
        if (dir.isDirectory()) {
            File[] subs = dir.listFiles(file -> file.getName().endsWith(".txt"));
            for (File sbu:subs){
                System.out.println(sbu.getName());
            }

        }
    }
}